package cn.itcast;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @author syf
 * @version 1.0
 * @date 2019/07/25 17:13
 * @Description TODO:服务调用者的启动类
 */
//@SpringBootApplication
//@EnableDiscoveryClient // 开启Eureka客户端
//@EnableCircuitBreaker //-- 断路器
    @SpringCloudApplication  //组合注解
public class ConsumerApplication {

    @Bean
    @LoadBalanced  //因为Eureka中已经集成了Ribbon，所以我们无需引入新的依赖
    public RestTemplate restTemplate(){
        return new RestTemplate();
    }

    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class,args);
    }
}
